<ui:composition template="/templates/template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml" 
	xmlns:h="http://java.sun.com/jsf/html" 
	xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:a4j="http://richfaces.org/a4j" 
    xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:fn="http://java.sun.com/jsp/jstl/functions">
      		
			
<ui:define name="body">
		
<script type="text/javascript">		
		$(document).ready(function() { 
    $('input[type="checkbox"]').click(function() { 
        var index = $(this).attr('name').substr(3); // agafem el caracter 4
 
        index--; 


        //$('form #taulaInmobles2').each(function(){ ok
		//$('#j_idt212 #taulaInmobles3').each(function(){ //ok
			//$('#taulaInmobles2').each(function(){ //ok
        	
        	
        	
		        $('#carList tr').each(function() { 
		        	
		        	//$('td:eq(' + index + ')',this).css("color", "red");  // oculta la cela "index" 
		   			 $('th:eq(' + index + ')',this).toggle('slow');  // oculta el th de la cela "index"
		        	 $('td:eq(' + index + ')',this).toggle('slow');  // oculta la cela "index" 
		         	
		        }); 

//    	});
    }); 
}); 

	</script>	
		
		
	   <br/>
            <rich:dataTable width="483" id="carList" rows="15"
                value="#{inmobleForm.inmoblesVenedor}" var="item">
                <f:facet name="header">
                    <rich:columnGroup>
                        <h:column><h:outputText value="Make" /></h:column>
                        <h:column><h:outputText value="Model" /></h:column>
                        <h:column><h:outputText value="Price" /></h:column>
                        <h:column><h:outputText value="Mileage" /></h:column>
                    </rich:columnGroup>
                </f:facet>

                <h:column>
                    <h:outputText value="#{item.nom}" />
                </h:column>
                <h:column>
                    <h:outputText value="#{item.adreca}" />
                </h:column>
                <h:column>
                    <h:outputText value="#{item.preu}" />
                </h:column>
                <h:column>
                    <h:outputText value="#{item.metres}" />
                </h:column>
            </rich:dataTable>
            
            <rich:jQuery selector="#carList tr:odd" query="addClass('odd-row')" />
            <rich:jQuery selector="#carList tr:even" query="addClass('even-row')" />
            <rich:jQuery selector="#carList tr" query="mouseover(function(){jQuery(this).addClass('active-row')})"/>
            <rich:jQuery selector="#carList tr" query="mouseout(function(){jQuery(this).removeClass('active-row')})"/>
        <br/>

		
	<input type="checkbox" name="col2" checked="checked" />
	   	
	   	
	   	
	   	


 			
</ui:define>

</ui:composition>

